import axios from "axios";


// 使用自定义配置新建一个axios 实例，对axios 做一些基础配置
const instance = axios.create({
    baseURL: 'http://39.99.98.192/django-shop',
    timeout: 5000,
});


//请求拦截器
//instance.interceptors.request.use(function (config) {
    //设置token
   // config.headers["Authorization"] ="Bearer " + window.sessionStorage.getItem("token").login.token

//})


//响应拦截器
instance.interceptors.response.use(function (response) {


    if (response.status === 500 || response.status === 404){
        alert("在维护请稍候")
    }
    return response
})


export default instance